package com.example.blog.exception;

/**
 * @Classname A
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/1/26 12:27
 * @Created by wlh12
 */
public enum CommonErrorCode {
    DB_ERROR(10002, "数据库错误"),
    IO_ERROR(10003, "IO异常"),
    NET_ERROR(10004, "网络异常"),
    BUSINESS_ERROR(10005, "业务异常"),
    TRANSACTION_ERROR(10006, "事务异常"),
    UNKNOWN_ERROR(10001, "未知异常"),
    INVALID_PARAM(10007 , "请求参数非法"),
    PARAM_FORMAT_ERROR(10008, "参数格式错误"),
    REQUEST_REPEATED(10009, "重复的请求"),
    TIMEOUT(10010, "请求超时"),
    LOGIN(777, "需登录"),

    PERMISSIONS(888,"无权限"),

    ;
    private final Integer code;
    private final String message;

    private CommonErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}

